package com.sysu.homework.service.Impl;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import com.sysu.homework.DAO.TeachAssistantDAO;
import com.sysu.homework.model.TeachAssistant;
import com.sysu.homework.service.TeachAssistantService;

@Component("teachAssistantService")
public class TeachAssistantServiceImpl implements TeachAssistantService {
	private TeachAssistantDAO teachAssistantDAO;

	public TeachAssistantDAO getTeachAssistantDAO() {
		return teachAssistantDAO;
	}

	@Resource
	public void setTeachAssistantDAO(TeachAssistantDAO teachAssistantDAO) {
		this.teachAssistantDAO = teachAssistantDAO;
	}

	@Override
	public TeachAssistant getTeachAssistantById(int id) {
		if (id != 0)
			return teachAssistantDAO.getTeachAssistantById(id);
		return null;
	}
	@Override
	public boolean isVaild(int id, String password) {
		if (id!=0 && password !=null)
			return teachAssistantDAO.isValid(id, password);
		return false;
	}
	

	

}
